﻿using System;
using System.Runtime.Serialization;
using System.ComponentModel;

namespace OnlineGameLibrary.Contract
{
    [DataContract(Namespace = "http://gameservice")]
    public partial class Player:INotifyPropertyChanged
    {
        string playerid;
        [DataMember]
        public string PlayerID
        {
            set
            {
                if (playerid != value)
                {
                    playerid = value;
                    onPropertyChanged("PlayerID");
                }
            }
            get
            {
                return playerid;
            }
        }

        string playerdisplayname;
        [DataMember]
        public string PlayerDisplayName
        {
            set
            {
                if (playerdisplayname != value)
                {
                    playerdisplayname = value;
                    onPropertyChanged("PlayerDisplayName");
                }
            }
            get
            {
                return playerdisplayname;
            }
        }

        PlayerState playerstate;
        [DataMember]
        public PlayerState PlayerState
        {
            set
            {
                if (playerstate != value)
                {
                    playerstate = value;
                    onPropertyChanged("PlayerState");
                }
            }
            get
            {
                return playerstate;
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        void onPropertyChanged(string propertyname)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this,
                    new PropertyChangedEventArgs(propertyname));
            }
        }
    }
}
